package com.garlicts.framework.binlog.sync.event;

public enum EventEnum {
	INSERT("insert", "插入"), 
	UPDATE("update", "更新"), 
	DELETE("delete", "删除");

	private String code;
	private String desc;

	EventEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public String getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}

	public static String getDescByCode(String code) {
		EventEnum[] values = values();
		for (EventEnum e : values) {
			if (e.getCode() == code) {
				return e.getDesc();
			}
		}
		return "";
	}

}
